﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using A2Z.BusinessService;
using KYO.DAL;
using ObjectPersistence;
using BusinessLayerHelper;

public partial class Modules_Mod_Information_ListComments : UserControl, IView<PersistentList<Comment>>
{
    //InforService inforService = new InforService();
   

    protected void Page_Load(object sender, EventArgs e)
    {
        
    }
    protected override void OnInit(EventArgs e)
    {
        CollectionPager1.MaxPages = 40;
        CollectionPager1.PageSize = 8;
        base.OnInit(e);
    }


    #region IView<PersistentList<Comment>> Members

    public void UpdateView(PersistentList<Comment> o)
    {
        //Set DataSource of Pager to Sample Data
        CollectionPager1.DataSource = o;
        numberComments.InnerHtml = o.Count + " Comment";
        // CollectionPager1.co
        //Let the Pager know what Control it needs to DataBind during the PreRender	
        CollectionPager1.BindToControl = Repeater1;

        //Set the DataSource of the Repeater to the PagedData coming from the Pager.
        Repeater1.DataSource = CollectionPager1.DataSourcePaged;
        Repeater1.DataBind();
    }

    public PersistentList<Comment> UpdateModel(PersistentList<Comment> o)
    {
        throw new NotImplementedException();
    }

    #endregion
}
